package com.card.game;

import com.card.game.event.EventType;

/**   
 * @Description: TODO(用一句话描述该文件做什么) 
 * @author siyunlong  
 * @date 2016年8月22日 上午10:20:01 
 * @version V1.0   
 */
public class PlayerInfo {
	private BasePlayer player;
	private Card firstOut;
	private EventType waitType;
	
	private int disbandReply;
	private String lastGangId;
	
	private int kaihuaNum;
	
	public PlayerInfo(BasePlayer player) {
		this.player = player;
	}
	public Card getFirstOut() {
		return firstOut;
	}
	
	public EventType getWaitType() {
		return waitType;
	}
	public void setWaitType(EventType waitType) {
		if(waitType == EventType.GangTouKaiHua) {
			this.kaihuaNum ++;
		}
		if(waitType == null) {
			this.kaihuaNum = 0;
		}
		this.waitType = waitType;
	}
	public void setFirstOut(Card firstOut) {
		if(this.firstOut == null && ((Player)player).outCards.isEmpty()) {
			this.firstOut = firstOut;
		}
	}
	public DisbandReply getDisbandReply() {
		return new DisbandReply(player, disbandReply);
	}
	public void setDisbandReply(int disbandReply) {
		this.disbandReply = disbandReply;
	}
	public String getLastGangId() {
		return lastGangId;
	}
	public void setLastGangId(String lastGangId) {
		this.lastGangId = lastGangId;
	}
	public int getKaihuaNum() {
		return kaihuaNum;
	}
	public void setKaihuaNum(int kaihuaNum) {
		this.kaihuaNum = kaihuaNum;
	}
	public void endGame() {
		this.firstOut = null;
		this.lastGangId = null;
		this.kaihuaNum = 0;
	}
}
